cmake_minimum_required (VERSION 3.1)

# cmake -DCMAKE_TOOLCHAIN_FILE=../fuxi_setup.cmake -DDEBUG=ON ..

project(temperature C)

# macro define...
set(SOFTWAREVERSION_H 1)
set(SOFTWAREVERSION_L 25)
set(JSON_LEN 2048)

# debug message
option(DEBUG "debug flag..." OFF)
if(DEBUG)
add_definitions(-DDEBUG -DDEBUG_TIME)
endif(DEBUG)


configure_file(
    "${PROJECT_SOURCE_DIR}/temperature_conf.h.in"
    "${PROJECT_BINARY_DIR}/temperature_conf.h")


file(GLOB_RECURSE SOURCES
    "${PROJECT_SOURCE_DIR}/src/*.c"
)

include_directories(
   "${PROJECT_SOURCE_DIR}/src"
	"${PROJECT_BINARY_DIR}"
)


#link_libraries(pthread)


# ---  输出目标路径
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/target/${PLATFORM_NAME})
message("Set target to ${EXECUTABLE_OUTPUT_PATH}")

set(CMAKE_VERBOSE_MAKEFILE ON)


# ---  构建主程序 ---
add_executable(${PROJECT_NAME} ${SOURCES})
